<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="获取数据" id="button" onclick="button()">
<table>
    <tr>
        <td>姓名</td>
        <td>年龄</td>
        <td>性别</td>
    </tr>
</table>
<script src="/static/layui/layui.all.js"></script>
<script type="text/javascript">
    var $=layui.jquery;
    function button() {
        $.ajax({
            url:"/login/a1",
            success:function (data) {
                var table=$("table")
                console.log(data)
                var html="";
                for(var i=0;i<data.length;i++){
                    html+="<tr>"+
                        "<td>"+data[i].name+"</td>"
                        +"<td>"+data[i].age+"</td>"+
                        "<td>"+data[i].sex+"<td/>"
                        +"<tr>";
                }
               table.append(html)
            }
        })
    }


</script>
</body>
</html>